package concurrent.producerconsumer;

/**
 * Author: Jason Wu
 * Date  : 2014-03-12
 */
public class UpdateThreadCount implements Runnable{
    private DynamicThreadPool executor;

    public UpdateThreadCount(DynamicThreadPool executor) {
        this.executor = executor;
    }

    @Override
    public void run() {
        try {
            Thread.sleep(6000);
            executor.updateThreadCount(10);

            Thread.sleep(8000);
            executor.updateThreadCount(2);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
